#include "raid.h"

int main(int argc, char** argv) {

	int choice;
	while(1) {
		//system("clear");
		printf ("==== RAID5 Recovery Algorithm ====\n");
		printf ("Enter your choice\n");
		printf ("1: Create Parity\n");
		printf ("2: Recover Data\n");
		scanf ("%d", &choice);
		printf ("==================================\n");
		switch(choice) {
			case 1:
				do_parity();
				break;
			case 2:
				printf ("Which device is lost? [0/1]: ");
				scanf ("%d", &choice);
				if (choice < 0 || choice > 1){
					printf ("Wrong input!\n");
					exit(1);
				} else 
					do_recovery(choice);
					break;
			default:
				printf ("Bye!\n");
				exit(0);
		}
	}

	return 0;
}
